package com.woniu.register.service.impl;

import com.woniu.register.dto.OwnerDTO;
import com.woniu.register.entity.OwnerTransfer;
import com.woniu.register.mapper.OwnerTransferMapper;
import com.woniu.register.service.OwnerTransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author ：zhulongxing
 * @date ：Created in 2022/12/6 19:24
 * @description：
 * @modified By：
 * @version: $
 */
@Service
public class OwnerTransferServiceImpl implements OwnerTransferService {

    @Autowired
    OwnerTransferMapper ownerTransferMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return 0;
    }

    @Override
    public int insert(OwnerTransfer record) {
        return 0;
    }

    @Override
    public int insertSelective(OwnerTransfer record) {
        return 0;
    }

    @Override
    public OwnerTransfer selectByPrimaryKey(Long id) {
        return null;
    }

    @Override
    public int updateByPrimaryKeySelective(OwnerTransfer record) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(OwnerTransfer record) {
        return 0;
    }

    @Override
    public int insertOwnerTransfer(OwnerDTO owner) {
        OwnerTransfer owner1 = new OwnerTransfer();
        Date date = new Date();
        String time = String.valueOf(date.getTime());
        owner1.setBusinessNum(time);
        owner1.setDirectoryId(owner.getDirectoryId());
        owner1.setProposerId(owner.getProposerId());
        owner1.setPrecontractStatus("<已受理>");
        owner1.setCommonerId(owner.getCommonerId());
        owner1.setOwnerErtificateNum("这是所有权证明号");
        owner1.setRegisterTime(date);
        owner1.setOwnerTypeId(owner.getTypeId());
        return ownerTransferMapper.insertOwnerTransfer(owner1);
    }
}
